package com.niiwoo.civet.account.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 企业帐户类型枚举
 * @author TomXue
 * @date 2018-04-27
 */
@AllArgsConstructor
@Getter
public enum AccountCompanyAccountTypeEnum {
    COOPERATE_ORG((byte)1,"合作机构"),
    GUARANTEE_ORG((byte)2,"担保机构"),
    COUNTER_GUARANTEE_ORG((byte)3,"反担保机构"),
    BORROW_ORG((byte)4,"企业借款人"),
    INVEST_ORG((byte)5,"企业投资人");

    private Byte type;
    private String desc;

    public static AccountCompanyAccountTypeEnum enumOf(Byte value) {
        for (AccountCompanyAccountTypeEnum accountCompanyAccountTypeEnum : values()) {
            if (accountCompanyAccountTypeEnum.type.equals(value)) {
                return accountCompanyAccountTypeEnum;
            }
        }
        throw new NoSuchEnumValueException("AccountCompanyAccountTypeEnum:" + value);
    }
}
